function showDetail(id) {
    window.location.href = `detail.html?id=${id}`;
}

// 搜索功能
document.querySelector('.search-bar button').addEventListener('click', function() {
    const searchTerm = document.querySelector('.search-bar input').value.toLowerCase();
    const plants = document.querySelectorAll('.plant-card');
    
    plants.forEach(plant => {
        const plantName = plant.querySelector('h3').textContent.toLowerCase();
        if (plantName.includes(searchTerm)) {
            plant.style.display = 'block';
        } else {
            plant.style.display = 'none';
        }
    });
}); 